import { Button, Card, Switch, Table } from "antd";
import PersonTitle from "./components/PersonTitle";

function index() {
  const dataSource = [
    {
      key: "1",
      nickname: "胡彦斌",
      sex: "男",
      username: "胡彦斌",
      email: "11111",
      age: 32,
      address: "西湖区湖底公园1号",
      createTime: "2021-09-01",
    },
    {
      key: "2",
      nickname: "胡彦斌",
      sex: "男",
      username: "胡彦斌",
      email: "11111",
      age: 32,
      address: "西湖区湖底公园1号",
      createTime: "2021-09-01",
    },
  ];

  const columns = [
    {
      title: "序号",
      dataIndex: "key",
      key: "id",
    },
    {
      title: "邮箱",
      dataIndex: "email",
      key: "email",
    },
    {
      title: "账号",
      dataIndex: "username",
      key: "username",
    },
    {
      title: "昵称",
      dataIndex: "nickname",
      key: "nickname",
    },
    {
      title: "年龄",
      dataIndex: "age",
      key: "age",
    },
    {
      title: "性别",
      dataIndex: "sex",
      key: "sex",
    },
    {
      title: "注册时间",
      dataIndex: "createTime",
      key: "createTime",
    },
    {
      title: "地址",
      dataIndex: "address",
      key: "address",
    },
    {
      title: "封号",
      key: "suspension",
      render: () => (
        <>
          <Switch />
        </>
      ),
    },
    {
      title: "操作",
      key: "address",
      render: () => (
        <>
          <Button>编辑</Button>
          <Button style={{ marginLeft: 10 }}>删除</Button>
        </>
      ),
    },
  ];
  return (
    <div>
      <Card title={<PersonTitle />}>
        <Table columns={columns} dataSource={dataSource} />
      </Card>
    </div>
  );
}

export default index;
